]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
animation: Turn Spinner animate parameter into Params option
authorJoonas Henriksson <joonas.henriksson@gmail.com>
Mon, 18 Nov 2019 20:18:29 +0000 (22:18 +0200)
committerJoonas Henriksson <joonas.henriksson@gmail.com>
Tue, 19 Nov 2019 17:54:13 +0000 (19:54 +0200)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/832

js/ui/animation.js
js/ui/components/keyring.js
js/ui/components/polkitAgent.js
js/ui/panel.js
js/ui/shellMountOperation.js

index 0db7cd80ebb3bf955c0d42de819192acb698daa8..6002a3754e779b78ed661fe51ba5dc79f958973e 100644 (file)
@@ -3,6 +3,8 @@
 
 const { Clutter, GLib, GObject, Gio, St } = imports.gi;
 
+const Params = imports.misc.params;
+
 var ANIMATED_ICON_UPDATE_TIMEOUT = 16;
 var SPINNER_ANIMATION_TIME = 300;
 var SPINNER_ANIMATION_DELAY = 1000;
@@ -136,12 +138,15 @@ class AnimatedIcon extends Animation {
 
 var Spinner = GObject.registerClass(
 class Spinner extends AnimatedIcon {
-    _init(size, animate = false) {
+    _init(size, params) {
+        params = Params.parse(params, {
+            animate: false,
+        });
         let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
         super._init(file, size);
 
         this.opacity = 0;
-        this._animate = animate;
+        this._animate = params.animate;
     }
 
     _onDestroy() {
index 8455eaa4e89b8ef1de9c4d1269c168ab2ae5e64a..8d0eccaa6b24ea37c54ef6e75ee683ce699f7310 100644 (file)
@@ -78,7 +78,9 @@ class KeyringDialog extends ModalDialog.ModalDialog {
             ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
             this._passwordEntry.clutter_text.connect('activate', this._onPasswordActivate.bind(this));
 
-            this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+            this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+                animate: true,
+            });
 
             if (rtl) {
                 layout.attach(this._workSpinner, 0, row, 1, 1);
index a25d65100315017d91c3ef37f9655b498ad327a3..bef62bd9525002fd747e0dba520127967a703f7f 100644 (file)
@@ -103,7 +103,9 @@ var AuthenticationDialog = GObject.registerClass({
             GObject.BindingFlags.SYNC_CREATE);
         this._passwordBox.add_child(this._passwordEntry);
 
-        this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+        this._workspinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+            animate: true,
+        });
         this._passwordBox.add(this._workSpinner);
 
         this._passwordBox.hide();
index e8e45b0abb5b1f17e5a1fc10b23efbcf8b844e40..9e05722bfffffd111fcc22500947fbae23130536 100644 (file)
@@ -237,7 +237,9 @@ var AppMenuButton = GObject.registerClass({
         this._overviewHidingId = Main.overview.connect('hiding', this._sync.bind(this));
         this._overviewShowingId = Main.overview.connect('showing', this._sync.bind(this));
 
-        this._spinner = new Animation.Spinner(PANEL_ICON_SIZE, true);
+        this._spinner = new Animation.Spinner(PANEL_ICON_SIZE, {
+            animate: true,
+        });
         this._container.add_actor(this._spinner);
 
         let menu = new AppMenu(this);
index 4934ee42667c0768d783033ae644b01af49b756a..68a6d32860d7ea53ee04830c632d393174d134f8 100644 (file)
@@ -362,7 +362,9 @@ var ShellMountPasswordDialog = GObject.registerClass({
         this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
         ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
         this.setInitialKeyFocus(this._passwordEntry);
-        this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+        this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+            animate: true,
+        });
         this._passwordEntry.secondary_icon = this._workSpinner;
 
         if (rtl) {